import {Button, Flex, Input} from "antd";
import {useNavigate} from "react-router-dom";

interface IProps {
    setName: (name: string) => void
    getList: () => void
}

const RecentlySearch = ({ setName, getList }: IProps) => {
    const navigate = useNavigate()
    const create = () => {
        navigate('/recently/details')
    }
    const changeName = (e: { target: { value: string } }) => {
        setName(e.target.value)
    }
    return (
        <Flex gap='middle' wrap>
            <div>搜索条件</div>
            <Input placeholder='名称' onChange={changeName} style={{width: '210px'}}/>
            <Button type='primary' onClick={getList}>搜索</Button>
            <Button type='primary' onClick={create}>新建</Button>
        </Flex>
    )
}

export default RecentlySearch